﻿Namespace Catalog.Search
    Public Structure QuerySort
        Public Field As QuerySortField
        Public SortDir As QuerySortDirection

        Public Sub New(fld As QuerySortField, dir As QuerySortDirection)
            Me.Field = fld
            Me.SortDir = dir
        End Sub

        Public Sub New(fld As QuerySortField)
            Me.New(fld, QuerySortDirection.ascending)
        End Sub

        Public Shared ReadOnly Property ReleaseDate As QuerySort
            Get
                Return New QuerySort(QuerySortField.releaseDate)
            End Get
        End Property

        Public Shared ReadOnly Property PublishDate As QuerySort
            Get
                Return New QuerySort(QuerySortField.publishDate)
            End Get
        End Property

        Public Shared ReadOnly Property ReleaseId As QuerySort
            Get
                Return New QuerySort(QuerySortField.releaseId)
            End Get
        End Property

        Public Shared ReadOnly Property TrackName As QuerySort
            Get
                Return New QuerySort(QuerySortField.trackName)
            End Get
        End Property

        Public Shared ReadOnly Property TrackId As QuerySort
            Get
                Return New QuerySort(QuerySortField.trackId)
            End Get
        End Property

        Public Shared ReadOnly Property LabelName As QuerySort
            Get
                Return New QuerySort(QuerySortField.labelName)
            End Get
        End Property

        Public Shared ReadOnly Property GenreName As QuerySort
            Get
                Return New QuerySort(QuerySortField.genreName)
            End Get
        End Property
    End Structure

    Public Enum QuerySortField
        releaseDate
        publishDate
        releaseId
        trackName
        trackId
        labelName
        genreName
    End Enum

    Public Enum QuerySortDirection
        ascending
        descending
    End Enum
End Namespace
